<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" lang="en" th:with="unixstamp=${#dates.createNow().time}">
<head th:replace="common::header"></head>
<body>
	<div class="layui-fluid">
		<div class="layui-row">
			<div class="layui-col-md12">
				<div class="layui-card">
					<div class="layui-card-header t-title layui-bg-cyan mlk-title">商品管理</div>
					<div class="layui-card-body">
						<table class="layui-table" id="table" lay-filter="table" style="height:100%;"></table>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>

<!--修改商品信息-->
<div id="updateLayer" style="display: none">
    <form class="layui-form layui-form-pane" lay-filter="updateForm">
        <input type="hidden" name="id">
        <div class="layui-form-item" pane>
            <label class="layui-form-label">商品名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" required  lay-verify="required" placeholder="请输入商品名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">关键词</label>
            <div class="layui-input-block">
                <input type="text" name="keyword" required  lay-verify="required" placeholder="请输入关键词" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">产品类别</label>
            <div class="layui-input-block">
                <select name="typeId" lay-verify="required">
                </select>
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">品牌</label>
            <div class="layui-input-block">
                <input type="text" name="branch" required  lay-verify="required" placeholder="请输入品牌" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">价钱</label>
            <div class="layui-input-block">
                <input type="text" name="price" required  lay-verify="required" placeholder="请输入价钱" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="update">立即提交</button>
            </div>
        </div>
    </form>
</div>
<!--商品描述信息修改-->
<div id="updateIntroduce" class="mlk-hide">
    <textarea  id="introduceTextArea" ></textarea>
</div>
<!--商品图片信息修改-->
<div class="mlk-hide" id="updateGoodPic">
    <div class="layui-upload">
        <button type="button" class="layui-btn" id="test2">多图片上传</button>
        <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
            预览图：
            <div class="layui-upload-list" id="demo2"></div>
        </blockquote>
    </div>
</div>

<!--
    商品规格修改弹出层
-->
<div id="updateParamLayer" class="mlk-hide">
    <table id="updateParamTable" lay-filter="updateParamTable"></table>
</div>

<div id="addParamItemlayer" class="mlk-hide">
    <form class="layui-form layui-form-pane" action="" id="addParamItemlayerForm">
        <input type="hidden" name="id" id="addParamItemlayerId">
        <input type="hidden" name="goodId" id="addParamItemlayerGoodId">
        <div class="layui-form-item" pane>
            <label class="layui-form-label">参数规格</label>
            <div class="layui-input-block">
                <input type="text" name="param" required  lay-verify="required" placeholder="请输入参数规格" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">积分最小占比</label>
            <div class="layui-input-block">
                <input type="text" name="minRate" required  lay-verify="required" placeholder="请输入积分最小占比(如0.1)" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">积分最大占比</label>
            <div class="layui-input-block">
                <input type="text" name="maxRate" required  lay-verify="required" placeholder="请输入积分最大占比(如0.1)" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">价钱</label>
            <div class="layui-input-block">
                <input type="text" name="price" required  lay-verify="required" placeholder="请输入参数规格对应的价钱" autocomplete="off" class="layui-input">
            </div>
        </div>
        <input type="reset" id="addParamItemlayerReset" class="mlk-hide">
    </form>
</div>
<script type="text/html" id="toolbar">
    <a class="layui-btn layui-btn-md" lay-event="addGood">新增商品</a>
</script>
<script type="text/html" id="tool">
    {{#  if(d.status == 1 ){ }}
    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="down">下架</a>
    {{#  } }}
    {{#  if(d.status == 0 ){ }}
    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="up">上架</a>
    {{#  } }}
    <a class="layui-btn layui-btn-sm layui-btn-warm" lay-event="update">商品修改</a>
    <a class="layui-btn layui-btn-sm layui-btn-warm" lay-event="updateIntroduce">描述信息修改</a>
    <a class="layui-btn layui-btn-sm layui-btn-warm" lay-event="updatePic">图片修改</a>
    <a class="layui-btn layui-btn-sm layui-btn-warm" lay-event="updateParam">规格修改</a>
</script>
<script type="text/html" id="paramTool">
    {{#  if(d.status == 1 ){ }}
    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="down">下架</a>
    {{#  } }}
    {{#  if(d.status == 0 ){ }}
    <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="up">上架</a>
    {{#  } }}
    <a class="layui-btn layui-btn-sm" lay-event="add">新增</a>
    <a class="layui-btn layui-btn-sm" lay-event="update">更新</a>
</script>
<div th:include="common::footer"></div>
<script type="text/javascript" th:src="@{/js/good/good.js}"></script>
</html>